// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_HR_EMPLOYEE
// * CreateDate    : 2014-11-18 14:17:07
// * Creater       : CodeSmith
// * LastChangeDate: 2014-11-18 14:17:07
// * LastChanger   : 2014-11-18 14:17:07
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
    [Serializable]
    public partial class HrEmployeeEntity : EntityBase
    {
        public HrEmployeeTable TableSchema
        {
            get
            {
                return HrEmployeeTable.Current;
            }
        }

        public HrEmployeeEntity()
        {

        }

        public HrEmployeeEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.PersonId = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_ID"]));
            this.IdNo = Convert.ToString(CommonFunctions.ToObject(dr["ID_NO"]));
            this.JoinDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["JOIN_DATE"]));
            this.LeaveDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LEAVE_DATE"]));
            this.BasicSalary = Convert.ToDecimal(CommonFunctions.ToObject(dr["BASIC_SALARY"]));
            this.PoliticalLandscape = Convert.ToString(CommonFunctions.ToObject(dr["POLITICAL_LANDSCAPE"]));
            this.JoinPartyDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["JOIN_PARTY_DATE"]));
            this.Education = Convert.ToString(CommonFunctions.ToObject(dr["EDUCATION"]));
            this.Major = Convert.ToString(CommonFunctions.ToObject(dr["MAJOR"]));
            this.Minor = Convert.ToString(CommonFunctions.ToObject(dr["MINOR"]));
            this.OfficePhone = Convert.ToString(CommonFunctions.ToObject(dr["OFFICE_PHONE"]));
            this.ContractEndDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CONTRACT_END_DATE"]));
            this.ContractCode = Convert.ToString(CommonFunctions.ToObject(dr["CONTRACT_CODE"]));
            this.IsMarried = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_MARRIED"]));
            this.SocialFundAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["SOCIAL_FUND_AMOUNT"]));
            this.NativeAddress = Convert.ToString(CommonFunctions.ToObject(dr["NATIVE_ADDRESS"]));
            this.Title = Convert.ToString(CommonFunctions.ToObject(dr["TITLE"]));
            this.IsSocialSecurity = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_SOCIAL_SECURITY"]));
            this.SocialSecurityNo = Convert.ToString(CommonFunctions.ToObject(dr["SOCIAL_SECURITY_NO"]));
            this.EmployeeName = Convert.ToString(CommonFunctions.ToObject(dr["EMPLOYEE_NAME"]));
            this.EmployeeNo = Convert.ToString(CommonFunctions.ToObject(dr["EMPLOYEE_NO"]));
            this.DepartmentNo = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_NO"]));
            this.PositionId = Convert.ToString(CommonFunctions.ToObject(dr["POSITION_ID"]));
            this.Supervisor = Convert.ToString(CommonFunctions.ToObject(dr["SUPERVISOR"]));
            this.Gender = Convert.ToString(CommonFunctions.ToObject(dr["GENDER"]));
            this.Birthday = Convert.ToString(CommonFunctions.ToObject(dr["BIRTHDAY"]));
            this.Country = Convert.ToString(CommonFunctions.ToObject(dr["COUNTRY"]));
            this.Province = Convert.ToString(CommonFunctions.ToObject(dr["PROVINCE"]));
            this.City = Convert.ToString(CommonFunctions.ToObject(dr["CITY"]));
            this.Address = Convert.ToString(CommonFunctions.ToObject(dr["ADDRESS"]));
            this.Email = Convert.ToString(CommonFunctions.ToObject(dr["EMAIL"]));
            this.Mobile = Convert.ToString(CommonFunctions.ToObject(dr["MOBILE"]));
            this.Telephone = Convert.ToString(CommonFunctions.ToObject(dr["TELEPHONE"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
            this.AdvanceAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["ADVANCE_AMOUNT"]));
            this.PersonImage = (byte[])(CommonFunctions.ToObject(dr["PERSON_IMAGE"]));
        }

        public HrEmployeeEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.PersonId = Convert.ToString(CommonFunctions.ToObject(dr["PERSON_ID"]));
            this.IdNo = Convert.ToString(CommonFunctions.ToObject(dr["ID_NO"]));
            this.JoinDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["JOIN_DATE"]));
            this.LeaveDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["LEAVE_DATE"]));
            this.BasicSalary = Convert.ToDecimal(CommonFunctions.ToObject(dr["BASIC_SALARY"]));
            this.PoliticalLandscape = Convert.ToString(CommonFunctions.ToObject(dr["POLITICAL_LANDSCAPE"]));
            this.JoinPartyDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["JOIN_PARTY_DATE"]));
            this.Education = Convert.ToString(CommonFunctions.ToObject(dr["EDUCATION"]));
            this.Major = Convert.ToString(CommonFunctions.ToObject(dr["MAJOR"]));
            this.Minor = Convert.ToString(CommonFunctions.ToObject(dr["MINOR"]));
            this.OfficePhone = Convert.ToString(CommonFunctions.ToObject(dr["OFFICE_PHONE"]));
            this.ContractEndDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CONTRACT_END_DATE"]));
            this.ContractCode = Convert.ToString(CommonFunctions.ToObject(dr["CONTRACT_CODE"]));
            this.IsMarried = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_MARRIED"]));
            this.SocialFundAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["SOCIAL_FUND_AMOUNT"]));
            this.NativeAddress = Convert.ToString(CommonFunctions.ToObject(dr["NATIVE_ADDRESS"]));
            this.Title = Convert.ToString(CommonFunctions.ToObject(dr["TITLE"]));
            this.IsSocialSecurity = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_SOCIAL_SECURITY"]));
            this.SocialSecurityNo = Convert.ToString(CommonFunctions.ToObject(dr["SOCIAL_SECURITY_NO"]));
            this.EmployeeName = Convert.ToString(CommonFunctions.ToObject(dr["EMPLOYEE_NAME"]));
            this.EmployeeNo = Convert.ToString(CommonFunctions.ToObject(dr["EMPLOYEE_NO"]));
            this.DepartmentNo = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_NO"]));
            this.PositionId = Convert.ToString(CommonFunctions.ToObject(dr["POSITION_ID"]));
            this.Supervisor = Convert.ToString(CommonFunctions.ToObject(dr["SUPERVISOR"]));
            this.Gender = Convert.ToString(CommonFunctions.ToObject(dr["GENDER"]));
            this.Birthday = Convert.ToString(CommonFunctions.ToObject(dr["BIRTHDAY"]));
            this.Country = Convert.ToString(CommonFunctions.ToObject(dr["COUNTRY"]));
            this.Province = Convert.ToString(CommonFunctions.ToObject(dr["PROVINCE"]));
            this.City = Convert.ToString(CommonFunctions.ToObject(dr["CITY"]));
            this.Address = Convert.ToString(CommonFunctions.ToObject(dr["ADDRESS"]));
            this.Email = Convert.ToString(CommonFunctions.ToObject(dr["EMAIL"]));
            this.Mobile = Convert.ToString(CommonFunctions.ToObject(dr["MOBILE"]));
            this.Telephone = Convert.ToString(CommonFunctions.ToObject(dr["TELEPHONE"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
            this.AdvanceAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["ADVANCE_AMOUNT"]));
            this.PersonImage = (byte[])(CommonFunctions.ToObject(dr["PERSON_IMAGE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return HrEmployeeTable.Current;
            }
        }

        #region Perporty List
        [DataMember]
        public string PersonId
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_PERSON_ID)); }
            set { SetData(HrEmployeeTable.C_PERSON_ID, value); }
        }

        [DataMember]
        public string IdNo
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_ID_NO)); }
            set { SetData(HrEmployeeTable.C_ID_NO, value); }
        }

        [DataMember]
        public DateTime JoinDate
        {
            get { return Convert.ToDateTime(GetData(HrEmployeeTable.C_JOIN_DATE)); }
            set { SetData(HrEmployeeTable.C_JOIN_DATE, value); }
        }

        [DataMember]
        public DateTime LeaveDate
        {
            get { return Convert.ToDateTime(GetData(HrEmployeeTable.C_LEAVE_DATE)); }
            set { SetData(HrEmployeeTable.C_LEAVE_DATE, value); }
        }

        [DataMember]
        public decimal BasicSalary
        {
            get { return Convert.ToDecimal(GetData(HrEmployeeTable.C_BASIC_SALARY)); }
            set { SetData(HrEmployeeTable.C_BASIC_SALARY, value); }
        }

        [DataMember]
        public string PoliticalLandscape
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_POLITICAL_LANDSCAPE)); }
            set { SetData(HrEmployeeTable.C_POLITICAL_LANDSCAPE, value); }
        }

        [DataMember]
        public DateTime JoinPartyDate
        {
            get { return Convert.ToDateTime(GetData(HrEmployeeTable.C_JOIN_PARTY_DATE)); }
            set { SetData(HrEmployeeTable.C_JOIN_PARTY_DATE, value); }
        }

        [DataMember]
        public string Education
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_EDUCATION)); }
            set { SetData(HrEmployeeTable.C_EDUCATION, value); }
        }

        [DataMember]
        public string Major
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_MAJOR)); }
            set { SetData(HrEmployeeTable.C_MAJOR, value); }
        }

        [DataMember]
        public string Minor
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_MINOR)); }
            set { SetData(HrEmployeeTable.C_MINOR, value); }
        }

        [DataMember]
        public string OfficePhone
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_OFFICE_PHONE)); }
            set { SetData(HrEmployeeTable.C_OFFICE_PHONE, value); }
        }

        [DataMember]
        public DateTime ContractEndDate
        {
            get { return Convert.ToDateTime(GetData(HrEmployeeTable.C_CONTRACT_END_DATE)); }
            set { SetData(HrEmployeeTable.C_CONTRACT_END_DATE, value); }
        }

        [DataMember]
        public string ContractCode
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_CONTRACT_CODE)); }
            set { SetData(HrEmployeeTable.C_CONTRACT_CODE, value); }
        }

        [DataMember]
        public int IsMarried
        {
            get { return Convert.ToInt32(GetData(HrEmployeeTable.C_IS_MARRIED)); }
            set { SetData(HrEmployeeTable.C_IS_MARRIED, value); }
        }

        [DataMember]
        public decimal SocialFundAmount
        {
            get { return Convert.ToDecimal(GetData(HrEmployeeTable.C_SOCIAL_FUND_AMOUNT)); }
            set { SetData(HrEmployeeTable.C_SOCIAL_FUND_AMOUNT, value); }
        }

        [DataMember]
        public string NativeAddress
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_NATIVE_ADDRESS)); }
            set { SetData(HrEmployeeTable.C_NATIVE_ADDRESS, value); }
        }

        [DataMember]
        public string Title
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_TITLE)); }
            set { SetData(HrEmployeeTable.C_TITLE, value); }
        }

        [DataMember]
        public int IsSocialSecurity
        {
            get { return Convert.ToInt32(GetData(HrEmployeeTable.C_IS_SOCIAL_SECURITY)); }
            set { SetData(HrEmployeeTable.C_IS_SOCIAL_SECURITY, value); }
        }

        [DataMember]
        public string SocialSecurityNo
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_SOCIAL_SECURITY_NO)); }
            set { SetData(HrEmployeeTable.C_SOCIAL_SECURITY_NO, value); }
        }

        [DataMember]
        public string EmployeeName
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_EMPLOYEE_NAME)); }
            set { SetData(HrEmployeeTable.C_EMPLOYEE_NAME, value); }
        }

        [DataMember]
        public string EmployeeNo
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_EMPLOYEE_NO)); }
            set { SetData(HrEmployeeTable.C_EMPLOYEE_NO, value); }
        }

        [DataMember]
        public string DepartmentNo
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_DEPARTMENT_NO)); }
            set { SetData(HrEmployeeTable.C_DEPARTMENT_NO, value); }
        }

        [DataMember]
        public string PositionId
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_POSITION_ID)); }
            set { SetData(HrEmployeeTable.C_POSITION_ID, value); }
        }

        [DataMember]
        public string Supervisor
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_SUPERVISOR)); }
            set { SetData(HrEmployeeTable.C_SUPERVISOR, value); }
        }

        [DataMember]
        public string Gender
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_GENDER)); }
            set { SetData(HrEmployeeTable.C_GENDER, value); }
        }

        [DataMember]
        public string Birthday
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_BIRTHDAY)); }
            set { SetData(HrEmployeeTable.C_BIRTHDAY, value); }
        }

        [DataMember]
        public string Country
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_COUNTRY)); }
            set { SetData(HrEmployeeTable.C_COUNTRY, value); }
        }

        [DataMember]
        public string Province
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_PROVINCE)); }
            set { SetData(HrEmployeeTable.C_PROVINCE, value); }
        }

        [DataMember]
        public string City
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_CITY)); }
            set { SetData(HrEmployeeTable.C_CITY, value); }
        }

        [DataMember]
        public string Address
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_ADDRESS)); }
            set { SetData(HrEmployeeTable.C_ADDRESS, value); }
        }

        [DataMember]
        public string Email
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_EMAIL)); }
            set { SetData(HrEmployeeTable.C_EMAIL, value); }
        }

        [DataMember]
        public string Mobile
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_MOBILE)); }
            set { SetData(HrEmployeeTable.C_MOBILE, value); }
        }

        [DataMember]
        public string Telephone
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_TELEPHONE)); }
            set { SetData(HrEmployeeTable.C_TELEPHONE, value); }
        }

        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(HrEmployeeTable.C_STATUS)); }
            set { SetData(HrEmployeeTable.C_STATUS, value); }
        }

        [DataMember]
        public decimal AdvanceAmount
        {
            get { return Convert.ToDecimal(GetData(HrEmployeeTable.C_ADVANCE_AMOUNT)); }
            set { SetData(HrEmployeeTable.C_ADVANCE_AMOUNT, value); }
        }

        [DataMember]
        public byte[] PersonImage
        {
            get { return (byte[])(GetData(HrEmployeeTable.C_PERSON_IMAGE)); }
            set { SetData(HrEmployeeTable.C_PERSON_IMAGE, value); }
        }

        #endregion
    }


}

